/* Copyright (c) 2001 IBK-Landquart-Switzerland. All rights reserved.
 *
 * Module      :  ZCsl.hpp
 * Application :  CSL kernel
 * Purpose     :  Native class interface
 *
 * Date        Description                                 Who
 * -------------------------------------------------------------------------------------------
 * 2013.01.05  First implementation                        J-L.Amitousa-Mankoy, B.de Finance  
 *
 * OPEN SOURCE LICENSE
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to IBK at info@ibk-software.ch.
 */

#define ZC_BUILDING_ZCSL

#include <ZCsl.hpp>
#include <cstring>
#include <cstdlib>

ZCsl::TraceEnvs::TraceEnvs(ZCsl* aParent): iParent(aParent)
{
	pushTraceEnv(); //There is alway at least an available env
}
ZCsl::TraceEnvs::~TraceEnvs() {}



void ZCsl::TraceEnvs::pushTraceEnv() 
{
	listTraceEnv.push_front(TraceEnv());
}
void ZCsl::TraceEnvs::popTraceEnv() 
{ 
	listTraceEnv.pop_front(); 
}


			
void ZCsl::TraceEnvs::setIsInMap(ZBoolean aBool) 
{
	listTraceEnv.front().setIsInMap(aBool);
}
void ZCsl::TraceEnvs::setIsInRestoreCC(ZBoolean aBool)
{
	listTraceEnv.front().setIsInRestoreCC(aBool);
}
void ZCsl::TraceEnvs::setIsInCallCC(ZBoolean aBool)
{
	listTraceEnv.front().setIsInCallCC(aBool);
}
void ZCsl::TraceEnvs::setCallCCFactorFound(ZBoolean aBool)
{
	listTraceEnv.front().setCallCCFactorFound(aBool);
}



void ZCsl::TraceEnvs::reinitExprTracesVar() 
{
	listTraceEnv.front().reinitExprTracesVar();
}
void ZCsl::TraceEnvs::reinitStmtTracesVar() 
{
	listTraceEnv.front().reinitStmtTracesVar();
}


			
ZBoolean ZCsl::TraceEnvs::isInMap()
{
	return listTraceEnv.front().isInMap();
}
ZBoolean ZCsl::TraceEnvs::isInRestoreCC()
{
	return listTraceEnv.front().isInRestoreCC();
}
ZBoolean ZCsl::TraceEnvs::isInCallCC()
{
	return listTraceEnv.front().isInCallCC();
}
ZBoolean  ZCsl::TraceEnvs::callCCFactorFound()
{
	return listTraceEnv.front().callCCFactorFound();
}












ZCsl::TraceEnv::TraceEnv() :
	boolIsInMap(zFalse),
	boolIsInRestoreCC(zFalse),
	boolIsInCallCC(zFalse),
	boolCallCCFactorFound(zFalse)
{
}
ZCsl::TraceEnv::~TraceEnv(){}
			
			
			
void ZCsl::TraceEnv::setIsInMap(ZBoolean aBool)
{
	boolIsInMap = aBool;
}
void ZCsl::TraceEnv::setIsInRestoreCC(ZBoolean aBool)
{
	boolIsInRestoreCC = aBool;
}
void ZCsl::TraceEnv::setIsInCallCC(ZBoolean aBool)
{
	boolIsInCallCC = aBool;
}
void ZCsl::TraceEnv::setCallCCFactorFound(ZBoolean aBool)
{
	boolCallCCFactorFound = aBool;
}
			
			
			
void ZCsl::TraceEnv::reinitExprTracesVar()
{
	boolIsInMap = boolIsInCallCC = boolIsInRestoreCC = zFalse;
}
void ZCsl::TraceEnv::reinitStmtTracesVar()
{
	boolCallCCFactorFound = zFalse;
}
			
			


ZBoolean ZCsl::TraceEnv::isInMap()
{
	return boolIsInMap;
}
ZBoolean ZCsl::TraceEnv::isInRestoreCC()
{
	return boolIsInRestoreCC;
}
ZBoolean ZCsl::TraceEnv::isInCallCC()
{
	return boolIsInCallCC;
}
ZBoolean ZCsl::TraceEnv::callCCFactorFound()
{
	return boolCallCCFactorFound;
}